using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class WorksheetMap : EntityTypeConfiguration<Worksheet>
    {
        public WorksheetMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Number)
                .HasMaxLength(64);

            this.Property(t => t.Number)
                .HasMaxLength(64);

            this.Property(t => t.ProductName)
                .HasMaxLength(128);

            this.Property(t => t.CreatorName)
                .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            this.Property(t => t.TechnologMemo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("Worksheet");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Edition).HasColumnName("Edition");
            this.Property(t => t.Data).HasColumnName("Data");
            this.Property(t => t.ApplyTime).HasColumnName("ApplyTime");
            this.Property(t => t.CreatorId).HasColumnName("CreatorId");
            this.Property(t => t.CreatorName).HasColumnName("CreatorName");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.ExpectedHours).HasColumnName("ExpectedHours");
            this.Property(t => t.ActualHours).HasColumnName("ActualHours");
            this.Property(t => t.ExpectedMaterial).HasColumnName("ExpectedMaterial");
            this.Property(t => t.ActualMaterial).HasColumnName("ActualMaterial");
            this.Property(t => t.Memo).HasColumnName("Memo");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.TotalWeight).HasColumnName("TotalWeight");
            this.Property(t => t.ProductId).HasColumnName("ProductId");
            this.Property(t => t.ProductName).HasColumnName("ProductName");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.ParentId).HasColumnName("ParentId");
            this.Property(t => t.EquipmentType).HasColumnName("EquipmentType");
            this.Property(t => t.TechType).HasColumnName("TechType");
            this.Property(t => t.LingData).HasColumnName("LingData");
            this.Property(t => t.TuiData).HasColumnName("TuiData");
            this.Property(t => t.WorkAmount).HasColumnName("WorkAmount");
            this.Property(t => t.StandardAmount).HasColumnName("StandardAmount");
            this.Property(t => t.ParentId).HasColumnName("ParentId");
            this.Property(t => t.OtherId).HasColumnName("OtherId");
            this.Property(t => t.WorkAmountAgain).HasColumnName("WorkAmountAgain");
            this.Property(t => t.TechnologyId).HasColumnName("TechnologyId");
            this.Property(t => t.ExamineStatus).HasColumnName("ExamineStatus");
            this.Property(t => t.PrintData).HasColumnName("PrintData");
            this.Property(t => t.TechnologMemo).HasColumnName("TechnologMemo");

        }
    }
}
